import { ComputedRef, computed } from "vue"
import Adv from "../adv";
interface Options {
  adv: ComputedRef<Adv>
}

function useJumpInfoEnumeration(options: Options) {
  const { adv } = options;
  const enumeration = computed(() => {
    const { creativor, position, market } = adv.value;
    // 视频号直播
    if (market.marketingTargetType === 'MARKETING_TARGET_TYPE_WECHAT_CHANNELS_LIVE') return [{
      label: '视频号直播',
      value: 'PAGE_TYPE_WECHAT_CHANNELS_WATCH_LIVE'
    }]
    // 视频卡片广告 16:9
    if (creativor.creativeTemplateId === 1708) {
      return [
        { value: 'PAGE_TYPE_WECHAT_MINI_PROGRAM', label: '微信小程序' },
        {
          value: 'PAGE_TYPE_WECHAT_CANVAS', 'label': '原生推广页',
          head_option: [
            { value: 'OPTION_CREATIVE_OVERRIDE_CANVAS', label: '使用外层创意素材替换原生推广页顶部素材' },
            { value: 'OPTION_CANVAS_OVERRIDE_CREATIVE', label: '使用原生推广页顶部素材作为外层创意素材' }
          ]
        }
      ]
    }
    // 闪频 9:16 / 横版视频 4:3
    if (creativor.creativeTemplateId === 1529 || creativor.creativeTemplateId === 618) {
      return [
        { value: 'PAGE_TYPE_WECHAT_MINI_PROGRAM', label: '微信小程序' },
        { value: 'PAGE_TYPE_WECHAT_CANVAS', 'label': '原生推广页' }
      ]
    }
    return [
      { value: 'PAGE_TYPE_WECHAT_MINI_PROGRAM', label: '微信小程序' },
      {
        value: 'PAGE_TYPE_WECHAT_CANVAS', 'label': '原生推广页',
        head_option: [
          { value: 'OPTION_CREATIVE_OVERRIDE_CANVAS', label: '使用外层创意素材替换原生推广页顶部素材' },
        ]
      }];
  });

  return {
    enumeration
  }
}

export {
  useJumpInfoEnumeration
}
